package com.game.actions;

import com.game.controllers.TurboController;
import com.game.objects.Environment;
import com.game.objects.Player;
import com.jme.input.action.InputAction;
import com.jme.input.action.InputActionEvent;

public class TurboAction extends InputAction{
	private Player player;
	private Environment ev;
	public TurboAction(Player player, Environment ev){
		this.player = player;
		this.ev = ev;
	}
	public void performAction(InputActionEvent evt) {
		for(int i=0; i<player.getPlayer().getControllers().size(); i++){
			if(player.getPlayer().getController(i) instanceof TurboController){
				return;
			}
		}
		player.getPlayer().addController(new TurboController(player, ev));
	}
}